# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=zeal
pkgver=0.7.0
pkgrel=1
pkgdesc="Offline documentation browser inspired by Dash"
url="https://zealdocs.org/"
arch="all !ppc64le !s390x !riscv64 !loongarch64"  # blocked by qt5-qtwebengine
license="GPL-3.0-only"
depends="hicolor-icon-theme"
makedepends="
	cmake
	extra-cmake-modules
	libarchive-dev
	qt5-qtbase-dev
	qt5-qtwebengine-dev
	qt5-qtx11extras-dev
	qt5-qtwebchannel-dev
	samurai
	sqlite-dev
	xcb-util-keysyms-dev
	"
source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/zealdocs/zeal/tar.gz/refs/tags/v$pkgver"
options="!check"  # no tests provided

build() {
	local crossopts=
	if [ "$CBUILD" != "$CHOST" ]; then
		crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -G Ninja -B build \
		-DQT_VERSION_MAJOR=5 \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=OFF \
		$crossopts .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5980d521ee923e9ef009aafdf24c146f63de5a8dccac63078d1125e86f1f36503d9c1ca2dc1b1365be71e67abfc18f43c48c212a52340ecc96aac25db072047e  zeal-0.7.0.tar.gz
"
